package com.big.sms.controller;

import com.big.common.result.Result;
import com.big.model.vo.sms.PaySmsVo;
import com.big.model.vo.sms.SendSmsDto;
import com.big.model.vo.sms.VerifyCodeDto;
import com.big.sms.service.SmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/sms/tx")
public class SmsController {

    @Autowired
    private SmsService smsService;

    @PostMapping("send")
    public Result send(@RequestBody SendSmsDto sendSmsDto) {
        smsService.sendSmsCode(sendSmsDto);
        return Result.ok();
    }


    @PostMapping("verify")
    public Result verify(@RequestBody VerifyCodeDto verifyCodeDto) {
        smsService.verifyCode(verifyCodeDto);
        return Result.ok();
    }


    @PostMapping("PaySend")
    public Result send(@RequestBody PaySmsVo paySmsVo) {
        smsService.sendSmsPay(paySmsVo);
        return Result.ok();
    }


}
